<script id="content" type="text/template">
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-property'()}-->" class="btn btn-default <!--if{http().anchor.query.property}--><!--else-->active<!--/if-->">全部类型</a>
		<a href="<!--helper {'anchor-query-property'('0')}-->" class="btn btn-default <!--if{http().anchor.query.property == '0'}-->active<!--/if-->">普通商品</a>
		<a href="<!--helper {'anchor-query-property'('1')}-->" class="btn btn-default <!--if{http().anchor.query.property == '1'}-->active<!--/if-->">积分商品</a>
	</div>
	
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-state'()}-->" class="btn btn-default <!--if{http().anchor.query.state}--><!--else-->active<!--/if-->">全部状态</a>
		<a href="<!--helper {'anchor-query-state'('3')}-->" class="btn btn-default <!--if{http().anchor.query.state == '3'}-->active<!--/if-->">停售编辑中</a>
		<a href="<!--helper {'anchor-query-state'('2')}-->" class="btn btn-default <!--if{http().anchor.query.state == '2'}-->active<!--/if-->">等待审核</a>
		<a href="<!--helper {'anchor-query-state'('1')}-->" class="btn btn-default <!--if{http().anchor.query.state == '1'}-->active<!--/if-->">售卖中</a>
		<a href="<!--helper {'anchor-query-state'('0')}-->" class="btn btn-default <!--if{http().anchor.query.state == '0'}-->active<!--/if-->">审核失败</a>
	</div>
	
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-when'()}-->" class="btn btn-default <!--if{http().anchor.query.when}--><!--else-->active<!--/if-->">全部时效</a>
		<a href="<!--helper {'anchor-query-when'('1')}-->" class="btn btn-default <!--if{http().anchor.query.when == '1'}-->active<!--/if-->">限时</a>
		<a href="<!--helper {'anchor-query-when'('0')}-->" class="btn btn-default <!--if{http().anchor.query.when == '0'}-->active<!--/if-->">非限时</a>
	</div>
	
	
	<!--<a href="#/shop/goods_add" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> 添加</a>-->
	<button class="btn btn-default" type="button" action-button="sort"><span class="glyphicon glyphicon-sort"></span> 排序</button>
	<button class="btn btn-default" type="button" action-button="state_publish"><span class="glyphicon glyphicon-ok-sign"></span> 售卖</button>
	<button class="btn btn-default" type="button" action-button="state_cancel_publish"><span class="glyphicon glyphicon-minus-sign"></span> 停售</button>
	<button class="btn btn-warning" type="button" action-button="trash"><span class="glyphicon glyphicon-trash"></span> 回收</button>
	<button class="btn btn-default search" type="button" ><span class="glyphicon glyphicon-filter"></span> 筛选</button>
	<!--if{http().anchor.query.search}--><span class="label label-default">存在筛选</span><!--/if-->
		
	<hr/>
	<table class="table table-striped">
      <thead>
        <tr>
          <th style="width: 2%;"><input type="checkbox" action-table="checkbox-all"></th>	
          <th style="width: 3%;">#</th>
          <th style="width: 23%;">
          	<!--if{http().anchor.query.sort == "name_desc"}-->
          	<a href="javascript:;" action-sort="name_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>商品名称</a>
          	<!--elseif{http().anchor.query.sort == "name_asc"}-->
          	<a href="javascript:;" action-sort="name_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>商品名称</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="name_desc">商品名称</a>
          	<!--/if-->
          	/
          	商品ID
          </th>
          <th style="width: 12%;">商品简介</th>
          <th style="width: 5%;">
          	<!--if{http().anchor.query.sort == "state_desc"}-->
          	<a href="javascript:;" action-sort="state_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>状态</a>
          	<!--elseif{http().anchor.query.sort == "state_asc"}-->
          	<a href="javascript:;" action-sort="state_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>状态</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="state_desc">状态</a>
          	<!--/if-->
          </th>
          <th style="width: 10%;">
          	<!--if{http().anchor.query.sort == "min_price_desc"}-->
          	<a href="javascript:;" action-sort="min_price_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>最底单价</a>
          	<!--elseif{http().anchor.query.sort == "min_price_asc"}-->
          	<a href="javascript:;" action-sort="min_price_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>最底单价</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="min_price_desc">最底单价</a>
          	<!--/if-->
          	~
          	<!--if{http().anchor.query.sort == "max_price_desc"}-->
          	<a href="javascript:;" action-sort="max_price_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>最高单价</a>
          	<!--elseif{http().anchor.query.sort == "max_price_asc"}-->
          	<a href="javascript:;" action-sort="max_price_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>最高单价</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="max_price_desc">最高单价</a>
          	<!--/if-->
          </th>
          <th style="width: 5%;">
          	<!--if{http().anchor.query.sort == "stock_sum_desc"}-->
          	<a href="javascript:;" action-sort="stock_sum_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>库存</a>
          	<!--elseif{http().anchor.query.sort == "stock_sum_asc"}-->
          	<a href="javascript:;" action-sort="stock_sum_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>库存</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="stock_sum_desc">库存</a>
          	<!--/if-->
          </th>
          <th style="width: 8%;">
          	<!--if{http().anchor.query.sort == "sort_desc"}-->
          	<a href="javascript:;" action-sort="sort_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>减库存方式</a>
          	<!--elseif{http().anchor.query.sort == "sort_asc"}-->
          	<a href="javascript:;" action-sort="sort_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>减库存方式</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="sort_desc">减库存方式</a>
          	<!--/if-->
          </th>
          
          <th style="width: 10%;">
          	<!--if{http().anchor.query.sort == "sort_desc"}-->
          	<a href="javascript:;" action-sort="sort_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>排序</a>
          	<!--elseif{http().anchor.query.sort == "sort_asc"}-->
          	<a href="javascript:;" action-sort="sort_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>排序</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="sort_desc">排序</a>
          	<!--/if-->
          </th>
          <th style="width: 12%;">
          	<!--if{http().anchor.query.sort == "update_time_desc"}-->
          	<a href="javascript:;" action-sort="update_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>更新时间</a>
          	<!--elseif{http().anchor.query.sort == "update_time_asc"}-->
          	<a href="javascript:;" action-sort="update_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>更新时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="update_time_desc">更新时间</a>
          	<!--/if-->
          </th>
          <th style="width: 10%;">操作</th>
        </tr>
      </thead>
      <tbody>
      	<!--if{response.list.data.length}-->
      	<!--for{var i in response.list.data}-->
      	<tr>
          <th><input type="checkbox" action-table="checkbox" data-id="<!--{response.list.data[i].shop_goods_id}-->"></th>
          <td><!--{parseInt(i)+1+((parseInt(response.list.page_now) - 1) * response.list.page_size)}--></td>
          <td>
          <div style="color: #999;">ID：<!--{response.list.data[i].shop_goods_id}--></div>
          <!--if{response.list.data[i].shop_goods_property == 1}-->
          <span class="label label-primary">积分商品</span>
          <!--/if-->
          <!--if{response.list.data[i].shop_goods_when}-->
          <a href="#/shop/goods_when_list/?sort=update_time_desc&search=%257B%2522shop_goods_id%2522%253A%2522<!--{response.list.data[i].shop_goods_id}-->%2522%257D" class="btn btn-default btn-xs">限时商品</a>
          <!--/if-->
          <!--{response.list.data[i].shop_goods_name}-->
          </td>
          <td>
          	<div id="tips-<!--{response.list.data[i].shop_goods_id}-->" class="tips" data-title="查看商品简介" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 150px;cursor: pointer;" data="<!--{response.list.data[i].shop_goods_info}-->"><!--{response.list.data[i].shop_goods_info}--></div>
          </td>
          <td>
          <!--if{parseInt(response.list.data[i].shop_goods_state) == 0}-->
          <span class="label label-danger">审核失败</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_state) == 1}-->
          <span class="label label-success">售卖中</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_state) == 2}-->
          <span class="label label-warning">等待审核</span>
          <!--elseif{parseInt(response.list.data[i].shop_goods_state) == 3}-->
          <span class="label label-info">停售编辑中</span>
          <!--/if-->
          </td>
          
          <td>
          	<!--if{response.list.data[i].shop_goods_min_price}-->
          	
	          	<!--if{response.list.data[i].shop_goods_property == 0}-->
	          		<!--{(parseInt(response.list.data[i].shop_goods_min_price)/100).toFixed(2)}-->元 ~ <!--{(parseInt(response.list.data[i].shop_goods_max_price)/100).toFixed(2)}-->元
	          	<!--else-->
	          		<!--{(response.list.data[i].shop_goods_min_price/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}-->积分 ~ <!--{(response.list.data[i].shop_goods_max_price/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}-->积分
          		<!--/if-->
          	<!--else-->
          	<span style="color: #999;">无库存即没价格</span>
          	<!--/if-->
          </td>
          
          <td>
          	<!--if{response.list.data[i].shop_goods_stock_sum === null}-->
          	<span style="color: #999;">无规格</span>
          	<!--else-->
          	<!--{response.list.data[i].shop_goods_stock_sum}-->
          	<!--/if-->
          </td>
          <td>
          	<span class="label label-default">
			<!--if{parseInt(response.list.data[i].shop_goods_stock_mode) == 0}-->
          	始终不减库存
			<!--elseif{parseInt(response.list.data[i].shop_goods_stock_mode) == 1}-->
          	下单预扣库存
          	<!--elseif{parseInt(response.list.data[i].shop_goods_stock_mode) == 2}-->
          	付款减库存
          	<!--elseif{parseInt(response.list.data[i].shop_goods_stock_mode) == 3}-->
          	发货减库存
          	<!--/if-->
          	</span>
          </td>
          <td><input type="text" class="form-control" placeholder="排序" action-table="sort" data-id="<!--{response.list.data[i].shop_goods_id}-->" value="<!--{response.list.data[i].shop_goods_sort}-->" style="max-width: 100px;"></td>
          <td><!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.list.data[i].shop_goods_update_time) * 1000)}--></td>
          <td>
          	<a href="<!--{av.router(av.router().url,'default.html#/shop-goodsEdit?id='+response.list.data[i].shop_goods_id).href}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>编辑</a>
          	<a href="<!--{av.router(av.router().url,'default.html#/shop-goodsAttr?sort=update_time_desc&id='+response.list.data[i].shop_goods_id).href}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>规格</a>
          	<a href="<!--{av.router(av.router().url,'default.html#/shop-goodsRegionList/?sort=update_time_desc&search=%257B%2522shop_goods_id%2522%253A%2522'+response.list.data[i].shop_goods_id+'%2522%257D').href}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>售卖地区</a>
          </td>
        </tr>
        <!--/for-->
      	<!--else-->
        <tr>
          <td colspan="15" align="center">无数据</td>
        </tr>
        <!--/if-->
      </tbody>
    </table>
    
    
	    
    <!--if{response.list.data.length}-->
	<div class="paging" style="text-align: center;">
		<button class="first btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="1" type="button">首页</button>
		<button class="previous btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="<!--{parseInt(response.list.page_now) - 1}-->" type="button">上一页</button>
		<button class="btn btn-default" type="button">
			第<!--{response.list.page_now}-->页
			/ 共<!--{response.list.page_count}-->页
			/ 有<!--{response.list.row_count}-->条数据</button>
		<button class="next btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{parseInt(response.list.page_now) + 1}-->">下一页</button>
		<button class="end btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{response.list.page_count}-->">尾页</button>
	</div>
	<div class="form-inline" style="text-align: center;margin-top: 10px;">
		<div class="form-group">
			<input type="text" class="form-control paging--value" placeholder="输入跳转页" style="width: 100px;">
		</div>
		<button type="button" class="btn btn-default paging--submit">跳转</button>
	</div>
	<!--/if-->
	
</script>





<script id="search" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
		    <label>商品ID：</label>
		    <input type="text" class="form-control" search placeholder="输入要搜索的商品ID" name="shop_goods_id" value="<!--{search.shop_goods_id}-->">
		</div>
		<div class="form-group">
		    <label>商品名称：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的商品名称" name="shop_goods_name" value="<!--{search.shop_goods_name}-->">
		</div>
		<div class="form-group">
		    <label>商家货号：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的商品货号" name="shop_goods_sn" value="<!--{search.shop_goods_sn}-->">
		</div>
		
		<br/>
		<div class="btn-group" style="width: 100%;">
			<button type="button" class="btn btn-primary" style="width: 50%;" name="search-submit">确定筛选</button>
			<button type="button" class="btn btn-default" style="width: 50%;" name="search-clear">清理筛选</button>
		</div>
	</div>
</script>

